import Vue from 'vue'
import VueRouter from 'vue-router'
import detail from '@/views/detail/detail'
import login from '@/views/login/login'
import order from '@/views/order/order'
import pay from '@/views/pay/pay'
import search from '@/views/search/search'
import searchList from '@/views/searchList/searchList'
import index from '@/views/index/index'
import shouye from '@/views/index/shouye'
import fenlei from '@/views/index/fenlei'
import gouwuche from '@/views/index/gouwuche'
import user from '@/views/index/user'

Vue.use(VueRouter)

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes: [
    { path: '/login', component: login },
    {
      path: '/',
      component: index,
      children: [
        { path: '/shouye', component: shouye },
        { path: '/fenlei', component: fenlei },
        { path: '/gouwuche', component: gouwuche },
        { path: '/user', component: user }
      ]
    },
    { path: '/detail', component: detail },
    { path: '/order', component: order },
    { path: '/pay', component: pay },
    { path: '/search', component: search },
    { path: '/searchList', component: searchList }
  ]
})

export default router
